{template 'common/header'}
	<div class="panel we7-panel ng-scope" >
	<div class="panel-heading">订单详情</div>
		<div class="panel-body we7-padding">
				<div class="form-horizontal">

					<div class="form-group" style="border-bottom: #9c9c9c 1px solid;">
					<label class="col-sm-2 control-label">
						<br>
						<br>
						<br>
					商品信息</label>	
					<label class="col-sm-2 control-label"><img style="width: 100%; height: 100%;" src="{$_W['attachurl']}{$o['titlepic']}"></label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						<br>
						商品名称：{$o['goodsname']}<br>
						商品价格：<b>¥ {$o['price']}</b><br>
						是否热门：{if $o['ishot']=='1'}热门商品{else}非热门商品{/if}<br>
						预约技师：{php echo dejson($o['details'],'techname')}

					</div>
			 		</div>

					<div class="form-group">
					<label class="col-sm-2 control-label">会员信息:</label>
					<div class="col-sm-6 control-label" style="text-align: left;">
						{if $o['uName']}{$o['uName']}{else}{php echo dejson($o['details'],'uname')}{/if}/{if $o['uPhone']}{$o['uPhone']}{else}{php echo dejson($o['details'],'phone')}{/if}/{php echo dejson($o['details'],'address')}
					</div>
			 		</div>

					<div class="form-group">
					<label class="col-sm-2 control-label">订单编号:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{$o['orderid']}
					</div>
			 		</div>	

					<div class="form-group">
					<label class="col-sm-2 control-label">订单状态:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{if $o['is_ok']=='1'}<span class="label label-success">已完成</span>
						{else}
						<span class="label label-danger">未完成</span>
						{/if}
					</div>
			 		</div>	

					<div class="form-group">
					<label class="col-sm-2 control-label">订单类型:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{if $o['order_type']=='1'}免费预约{else}支付预约{/if}

					</div>
			 		</div>	

					<div class="form-group">
					<label class="col-sm-2 control-label">是否支付:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{if $o['is_pay']=='1'}<span class="label label-success">已支付</span>
						{else}
						<span class="label label-danger">未支付</span>
						{/if}
					</div>
			 		</div>
					<div class="form-group">
					<label class="col-sm-2 control-label">优惠金额:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{$o['card_price']}
					</div>
			 		</div>
					<div class="form-group">
					<label class="col-sm-2 control-label">已付金额:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{$o['pay_money']} 
					</div>
			 		</div>				 		

					<div class="form-group">
						<label class="col-sm-2 control-label">到店需付:</label>
						<div class="col-sm-3 control-label" style="text-align: left;">
							{php echo $o['tmoney']-$o['pay_money']} 
						</div>
			 		</div>

					<div class="form-group">
					<label class="col-sm-2 control-label">创建时间:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{php echo date('Y-m-d H:i:s',$o['addtime'])}
					</div>
			 		</div>				 				 		

					<div class="form-group">
					<label class="col-sm-2 control-label">支付时间:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{if $o['pay_time']}{php echo date('Y-m-d H:i:s',$o['pay_time'])}{else}{/if}
					</div>
			 		</div>	

					<div class="form-group">
					<label class="col-sm-2 control-label">完成时间:</label>
					<div class="col-sm-3 control-label" style="text-align: left;">
						{if $o['ok_time']}{php echo date('Y-m-d H:i:s',$o['ok_time'])}{else}{/if}
					</div>
			 		</div>


			 		<div class="form-group" style="border-top: #9c9c9c 1px solid;">

			 			<div class="col-sm-2 control-label">
			 				<!-- <button type="button" class="btn btn-success">确认完成</button> -->
			 			</div>

			 			<div class="col-sm-2 control-label">
			 				<button type="button" id="isok" oid="{$o['oid']}" sid = "{$o['is_ok']}"  class="btn btn-success isok" {if $o['is_ok']=='1'}disabled="disabled"{else}{/if}>{if $o['is_ok']=='1'}已完成{else}确认完成{/if}</button>
			 			</div>
			 		</div>

				</div>
		</div>
	</div>		
	<style type="text/css">
		.right-content{padding: 0;}
	</style>
	<link rel="stylesheet" href="{MODULE_URL}public/css/Toast.css">
<script src="{MODULE_URL}public/js/Toast.js"></script> 
<script type="text/javascript">
	$(document).ready(function(){
		 $(document).on('click','.isok',function(){
	            var sid = $(this).attr('sid');
	            var oid = $(this).attr('oid');
	            if(sid !=1){
	                if(!confirm('您确认已完成该订单吗？')){
	                    window.event.returnValue = false;
	                }else{
	                    $.ajax({
	                        url:"{php echo $this->createWebUrl('orderisok');}&version_id="+"{$_GPC['version_id']}",
	                        data:{oid:oid,sid:sid},
	                        dataType:"json",
	                        type:"post",
	                        success:function(res){
	                            if(res.status==1){
	                                mqToast({type:1,context: res.msg});
	                                  setTimeout(function(){
	                                    window.location.reload();
	                                  },2000);
	                            }else{
	                                mqToast({type:1,context: res.msg});
	                            }
	                        }
	                    })
	                }
	            }else{
	                mqToast({type:1,context: '该订单已完成'});
	            }
			 })
	})		 
</script>
{template 'common/footer'}